﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace GwLib.UnitTesting
{
    public interface IObjectStore<T> where T : class, new()
    {
        void SetCopyImplementation(Func<object, object> copyDelegate);
        void AddTrigger(ObjectStoreTriggerType triggerType, Action<T, List<T>> trigger);
        void Reset();
        int Count { get; }
        T Insert(T obj);
        T UpdateWhere(T obj, Func<T, bool> where);
        T UpdateByColumn(T obj, Expression<Func<T, object>> columnExpression);
        int DeleteWhere(Func<T, bool> where);
        int DeleteByColumn(T obj, Expression<Func<T, object>> columnExpression);
        T SelectOne(Func<T, bool> where = null);
        List<T> SelectList(Func<T, bool> where = null);
    }
}
